The Portable Document Format (PDF) is a kind of electronic document format used to describe page contents. This format has various versions in which the most important is the PDF version 1.4. Before the PDF version 1.4 arises, a replacement model is used as the imaging model for the PDF specification. Based on the replacement model, color values in the page background are replaced by those in the current image element (such as a character, a figure and a graph) to be disposed in the page. Then, from the PDF version 1.4, a transparency model is introduced for the PDF specification. Based on the transparency model, the color values in the page background are not replaced by those in the current image element (such as a character, a figure and a graph) to be disposed in the page. Instead, a color-mixing operation is implemented by using the color values in the page background and the color values in the current image element to be disposed in the page. Then, the color values in the page background are replaced by those obtained by the color-mixing operation. By introducing the transparency model, the description capacity of the PDF file is improved significantly. For example, the PDF file is capable of supporting various special effects such as the transparency effect, the shading effect, the feathering effect and so on.
According to the PDF specification, the color-mixing transparency operation uses the following related parameters: the color values in the page background, the color values in the image element (i.e. the foreground), the contribution parameters of the image element (i.e. the Alpha parameters of the foreground), the contribution parameters of the background (i.e. the Alpha parameters of the background) and so on. When a transparency group is processed, the transparency operation further uses Shape parameters of the transparency group, the color values in an initial background of the transparency group and the contribution parameters of the initial background (i.e. the Alpha parameters of the initial background). All of the above parameters related to the color-mixing transparency operation are based on pixels. That is, the parameters of different pixels may be different from each other. Thus, all the pixels should be processed and stored individually. Moreover, the color-mixing transparency operation for each pixel should be based on at least an 8-bit depth. The bit depth is also called as pixel depth or color depth, which is used to denote how much color information can be used for displaying or printing each pixel in an image. If the bit depth is large, the information of each pixel is much, the colors available for a digital image are more, and the presented color for an image is precise. For example, a pixel with 1-bit depth has two possible values: black and white; and another pixel with 8-bit depth has 256 possible values. Thus, larger bit depth means larger amount of data. It can be seen that the color-mixing transparency operation is complicated, time-consuming and memory-consuming, especially in the case of a page including many transparency groups which are embedded with other transparency groups.
To support the transparency operation defined in the PDF version 1.4, various PDF rasterizing applications and devices (such as a reader for displaying PDF file contents, a PDF raster image processor and the like) use a method for rasterizing based on bitmap. Firstly, a file comprising PDF pages to be processed are scanned, according to the method. By judging whether the scanned file includes a transparency parameter, it can be determined which PDF page or PDF pages include one or more transparent objects. If a page is determined to include one or more transparent objects, each pixel in the page will be rasterized with the color-mixing transparency operation based on the transparency model to obtain the final 8-bit page bitmap. On the contrary, if a page is determined to include no transparent object, the page will be rasterized based on the conventional replacement model. In the method, transparency parameters are used to denote whether an image element is transparent and the transparent object refers to an object having a transparent property. A page including one or more transparent objects is called the transparent page. Since a whole page will be rasterized inseparably, the amount of data to be processed for a transparent page is very large so that the efficiency of the rasterization in this method is low.
According to another conventional method, the transparent page is rasterized in segments. Firstly, the page is divided into several page segments with a width same to the page. The page segments including no transparent object are rasterized based on the conventional replacement model to generate a page segment bitmap with an 8-bit depth. The page segments including one or more transparent objects are rasterized with the color-mixing transparency operation based on bitmap to generate a page segment bitmap with an 8-bit depth. According to this method, a page is divided into transparent page segments each including one or more transparent objects and nontransparent page segments including no transparent object. Then, the page is rasterized in segments. This method is better than the previous method. Since the speed of rasterizing a nontransparent page segment based on the replacement model is higher than that of rasterizing a transparent page segment based on the transparency model, the efficiency of the rasterization in this method is improved for a transparent page whose transparent objects are disposed in some of the segments.
However, the method also has some disadvantages. Each of the page segments has a width same to that of the page. Where a transparent object overlaps with the page in a whole height of the page, all of the page segments are transparent page segments. Thus, all pixels in the whole page should be processed with the color-mixing transparency operation based on the transparency model. Furthermore, during rasterization, it should store the page segment gray bitmaps of all color plates and the Shape and Alpha parameters of each pixel in all of the page segments. Each of the parameters should be presented by an 8-bit bitmap due to the color-mixing transparency operation. It can be seen that the method for rasterizing a page in segments is also memory-consuming, especially in the case of a rasterizing output device with a high resolution. For example, when a PDF page with A3 size is output by a phototypesetting device with an output resolution of 2,400 DPI, the amount of data of six page bitmaps for the Cyan, Magenta, Yellow and Black color plates and the Shape and Alpha parameters is up to 6 G bytes. Then, any operation (e.g. one clear operation) for a bitmap buffer of the page is time-consuming during the rasterization. Although the method for rasterizing a page in segments does not need to buffer all of the page segment bitmaps, the amount of image elements to be processed from different segments is increased so as to impact the efficiency of the rasterization.
It can be seen that the amount of data to be processed is very large according to the conventional methods for rasterizing based on bitmap. The methods are memory-consuming and the efficiency of the rasterization is very low.